Obviously I forgot about the "fraction()" function, so I removed/changed parts of this article (thanks @Mario for the hint) :-)
If you need the digits behind the decimal seperator of a number, you might subtract the integer of the number from the number itself: 1.3 - int(1.3) e.g. would result in 0.3. But there is a pitfall... try this with 38.3 - int(38.3), and LotusScript returns: 0.299999999999997. According to a colleague (yes, I asked ;-)), the reason is that some decimal numbers cannot be described exactly in binary format, or to be more exact, they are irrational in binary format. This leads to the inexact result above.
When doing arithmetic calculations with fractions, the result might not always be, what you expect: while in LotusScript 1.3 - int(1.3) results in 0.3, 38.3 - int(38.3) results in .. 0.299999999999997. According to a colleague (yes, I asked ;-)),
the reason is that some decimal numbers cannot be described exactly in
binary format, or to be more exact, they are irrational in binary
format. This leads to the inexact result above. So even on standard arithmetic calculations, it might always be a good thing to round your results to the most exact degree needed, e.g. instead of coding 38.3 - 38, code round(38.3 - 38, 1). But be aware... you might want to read this article first:
About the AuthorMarcus Foerster works
as Systems Architect for Pentos AG in Munich, Germany. His focus lies on
the application side, creating collaboration systems for users, groups
and enterprises to get their daily work done. This approach includes
integrating complex workflows with intuitive user interfaces, using
Lotus Notes/Domino with Adobe Flex and other Web technologies.
Read
more in Marcus' blog:
http://marcus.foerster.com/blog